#!/usr/bin/python
tup1 = ('physics', 'chemistry', 1997, 2000);
tup2 = (1, 2, 3, 4, 5, 6, 7 );

print "tup1[0]: ", tup1[0]
print "tup2[1:5]: ", tup2[1:5]





tup1 = (12, 34.56);
tup2 = ('abc', 'xyz');

# Following action is not valid for tuples
# tup1 += tup2;

# So let's create a new tuple as follows
tup3 = tup1 + tup2;
print tup3;





tup = ('physics', 'chemistry', 1997, 2000);

print tup;
del tup;
print "After deleting tup : "
print tup;



#basic tuple operations


aList = (123, 'xyz', 'zara', 'abc');
aTuple = tuple(aList)

print "Tuple elements : ", aTuple




tuple1, tuple2 = (123, 'xyz', 'zara', 'abc'), (456, 700, 200)

print "min value element : ", min(tuple1);
print "min value element : ", min(tuple2);




tuple1, tuple2 = (123, 'xyz', 'zara', 'abc'), (456, 700, 200)

print "Max value element : ", max(tuple1);
print "Max value element : ", max(tuple2);




tuple1, tuple2 = (123, 'xyz', 'zara'), (456, 'abc')

print "First tuple length : ", len(tuple1);
print "Second tuple length : ", len(tuple2);




tuple1, tuple2 = (123, 'xyz'), (456, 'abc')

print cmp(tuple1, tuple2);
print cmp(tuple2, tuple1);
tuple3 = tuple2 + (786,);
print cmp(tuple2, tuple3)